#pragma once
#include <vector>
#include <string>

using namespace std;

struct Vector2
{
	Vector2(void) {}
	Vector2(float x, float y)
	{
		this->x = x;
		this->y = y;
	}

	float x, y;

	bool operator ==(Vector2& other) { return x == other.x && y == other.y; }
};

struct Vector3
{
	Vector3(void) {}
	Vector3(float x, float y, float z)
	{
		this->x = x;
		this->y = y;
		this->z = z;
	}

	float x, y, z;

	bool operator ==(Vector3& other) { return x == other.x && y == other.y && z == other.z; }
};

struct Vertex
{
	Vertex(void)
	{
		memset(this, 0, sizeof(Vertex));
	}
	Vertex(Vector3& position, Vector3& normal, Vector2& texCoord, Vector3& tangent)
	{
		this->position = position;
		this->normal = normal;
		this->texCoord = texCoord;
		this->tangent = tangent;
	}

	Vector3 position;
	Vector3 normal;
	Vector3 tangent;
	Vector2 texCoord;

	bool operator ==(Vertex& other) { return position == other.position && normal == other.normal && texCoord == other.texCoord && tangent == other.tangent; }
};

union Triangle
{
	unsigned int e[3];

	struct
	{
		unsigned int A, B, C;
	};
};

struct Mesh
{
	string name;

	vector<Vertex> uniqueVertecies;
	vector<Triangle> indicies;
};